<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #div1{
            width:200px;height:200px; background:red;
        }
    </style>
    <script>
        function toWidth(){
          var oDiv=document.getElementById('div1');
          oDiv.style.width='400px';
        }
        function toHeight(){
            var oDiv=document.getElementById('div1');
            oDiv.style.height='400px';
        }
        function toGreen(){
            var oDiv=document.getElementById('div1');
            oDiv.style.background='green';
        }
    </script>
</head>
<body>
<input type="button" value="变宽" onclick="toWidth()">
<input type="button" value="变高" onclick="toHeight()">
<input type="button" value="变绿" onclick="toGreen()">
<div id="div1"></div>
</body>
</html>